#ifndef F_WCPAGE_H
#define F_WCPAGE_H

#include <QWidget>
#include <QtGui>
#include "clickedLabel.h"

class F_WcPage : public QWidget
{
    Q_OBJECT

public:
    F_WcPage(QWidget *parent = 0);
public:
    typedef struct _ETC_Send
        {
                char    de_name[6];
                char	sf;    /*算法选择  0表示工程算法，1表示理论算法, ! 表示复位 # 表示延时时间测量 */
                char	tbfs;  /*同步方式  0,同步输出；1,电秒脉冲；2,光秒脉冲3,B码电信号；4,B码光信号；5,50Hz倍频*/
                char	bzxz;  /*标准选择  0,5A；1,1A；2,100V；3,100/√3V；4,模拟小电压；5,谐波小电压*/
                float	xdyz;  /*小电压值  如果标准选择为4或者5，则有数，否则用0填充*/
                char        bcxz;  /*被测选择  0,5A；1,1A；2,100V；3,100/√3V；4,模拟小电压；5,9-1/2；6，FT3*/
                float       ydyz;   /*多样值    如果被测选择为0~3,则全部填充为0;如果为4,则用float类型填充;如果为5或者6,则填写通道号;*/
                char    ft3_tdh;    /*ft3通道号*/
                char	xbNum; /*谐波次数*/
                float       xbValue; /*额定一次值*/
                char netport[4];    /*输入端口*/
                char ex[20];
         }ETC_Send;

public:
    void getsendUdp(char* ch,int flag);
    int getStructLen();
public:
    QLabel *labDw;
    QLabel *labFz3;
    QLabel *labFz2;
    QLabel *labFz1;
    QLabel *labFz0;
    QLabel *labFz1a;
    QLabel *labFz2a;
    QLabel *labFz3a;
    QWidget *widget;
    QLabel *labFuzhi;
    QLabel *labFuzhiValue;

    QLineEdit *txtBzYxz;
    QLineEdit *txtBcYxz;
    QLineEdit *txtBc;
    QLineEdit *txtBzXw;
    QLineEdit *txtBcXw;
    QLineEdit *txtBzz;
    QLineEdit *txtBcz;
    QLineEdit *txtJc;

    QLineEdit *txtBFB;
    QLabel *labInfo;
    QLabel *labyxz;

    QLineEdit *txtMinBc;
    QLineEdit *txtMinJc;
    QLineEdit *txtMaxBc;
    QLineEdit *txtMaxJc;
    QLineEdit *txtAvgBc;
    QLineEdit *txtAvgJc;

    QLabel *labSync;
    QLabel *labSyncPng;
    QTableView *tabTd;
    QRadioButton *rdoCltd;
    QRadioButton *rdoAlltd;
//    QTextEdit *txtXX;
    QTabWidget *tabwc;
    QWidget *widgetWc;
    QWidget *widgetWcTxt;
    QWidget *widgetWcData;
    QWidget *widgetAdd;
    QComboBox *cboTbfs;
    QComboBox *cboBzSelect;
    QComboBox *cboBcSelect;
    QComboBox *cboPBcSelect;
    QComboBox *cboBctd;
    QComboBox *cboCTPT;
    QComboBox *cboJD;
    QComboBox *cboBhCl;
    QLineEdit *txtEdyc;
    QComboBox *cboEdycDw;
    QLineEdit *txtBzXdy;
    QLineEdit *txtBcXdy;
    QComboBox *cboCyfs;
    QLineEdit *txtMac;
    QLineEdit *txtTestNum;
    QComboBox *cboInput;
    QComboBox *cboSave;

    QPushButton *btnGet;
    QLabel *labBctd;
    QLabel *labBhCl;
    QLabel *labBzXdy;
    QLabel *labBcXdy;
    QLabel *labCyfs;
    QLabel *labMac;
    QWidget *widgetWcShow;

    QPushButton *btnAll;
    QPushButton *btnTest;
    QPushButton *btnSave;


    QTableView *tabWcData;
    QLineEdit *txtXuhao;
    QLineEdit *txtTbfs;
    QLineEdit *txtBzxz;
    QLineEdit *txtBcxz;
    QLineEdit *txtYc;
    QLineEdit *txtDate;
    QPushButton *btnFirst;
    QPushButton *btnPrevious;
    QPushButton *btnNext;
    QPushButton *btnLast;
    QPushButton *btnDel;
    QPushButton *btnFind;
    QStandardItemModel *model;
    QLabel *labYc;
    QLabel *labYcDw;
    QLabel *labDataCount;
    QLabel *labInput;
    QLabel *labInputMethod;
    QLabel *labMUYS;
    QLineEdit *txtMUYS;
    QAction *list_action;//=new QAction(tr("从扫描列表中获取"),this);
    QAction *scl_action;//=new QAction(tr("从配置文件中获取"),this);

public:
    ETC_Send *etc_send;
    int itype;
    int itime;
    int iNetPort;
    void inittabTd();
    void changeSty(int flag);
signals:
    void f_sigList();
    void f_sigScl();

public slots:
    void slotList();
    void slotScl();
    void changeBcSelect(int index);
};

#endif // F_WCPAGE_H

